<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/includes.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>优惠券</title>
<link type="text/css" rel="stylesheet" href="<c:url value='/css/reset.css'/>" />
<link type="text/css" rel="stylesheet" href="<c:url value='/css/app/baidu/coupon/coupon.css'/>" />
<link type="text/css" rel="stylesheet" href="<c:url value='/css/galleryview/galleryview.css'/>" />
<script type="text/javascript" src="<c:url value='/js/jquery-1.4.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/galleryview/jquery.easing.1.3.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/galleryview/jquery.galleryview-1.1.js'/>"></script>
<script type="text/javascript" src="<c:url value='/js/galleryview/jquery.timers-1.1.2.js'/>"></script>
<script type="text/javascript">
	$(document).ready(function(){
		changeCouponItem();
	});
	
	function initGalleryView(){
		$('#photos').galleryView({
			panel_width: 539,
			panel_height: 400,
			frame_width: 40,
			frame_height: 40,
			overlay_height:50,
			pause_on_hover:true
		});
	}
	
	function changeCouponItem(code){
		$.ajax({
			   type: "GET",
			   url:"<c:url value='/app/baidu/getCoupon.nhtml'/>",
			   data:"couponCode="+code,
			   cache: false,
			   success: function(result){
				   var coupon = "",filmstrip="";
				   $.each(result,function(i){
					   coupon+="<div class='panel'>";
					   coupon+="<img src='../.."+this.url+"' /> ";
					   coupon+="<div class='panel-overlay'>";
					   coupon+="<h2>"+this.name+"</h2>";
					   coupon+="<p>Photo by <a href='http://www.sxc.hu/profile/tomharry' target='_blank'>tomharry</a>.  View full-size photo <a href='http://www.sxc.hu/photo/158829' target='_blank'>here</a>.</p>";
					   coupon+="</div>";
					   coupon+="</div>";
					   filmstrip += " <li><img src='../.."+this.url+"' alt='Effet du soleil' title='Effet du soleil' width='40px' height='40px'/></li>";
				   });
				   $("#couponShowArea").empty();
				   $(".filmstrip").empty();
				   $("#couponShowArea").append(coupon);
				   $(".filmstrip").append(filmstrip);
				   initGalleryView();
			   }
	      });
		
	}
</script>
</head>
<body>
<div id="wrapper">  
	<div id="header">  
		 <ul id="quick">
		 <c:forEach var="product" items="${products }" varStatus="">
		 	<li id="bind_market"><a href="javascript:changeCouponItem('<c:out value='${product.code}'/>');"><img src='../..<c:out value="${product.logo }"/>'/><br/><c:out value="${product.name }"/></a></li> 
		 </c:forEach>
		 <!-- 
		 <li id="quick_signbar"><a href="javascript:void(0);" onclick="Serv.Apps.open('signbar','进度条','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_002.png"><br>进度条</a></li>
		 <li id="quick_vote"><a href="javascript:void(0);" onclick="Serv.Apps.open('vote','投票','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_013.png"><br>投票</a></li>
		 <li id="quick_member"><a href="javascript:void(0);" onclick="Serv.Apps.open('member','会员','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_014.png"><br>会员</a></li>
		 <li id="quick_auction"><a href="javascript:void(0);" onclick="Serv.Apps.open('auction','竞拍','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_004.png"><br>竞拍</a></li>
		 <li id="quick_magine"><a href="javascript:void(0);" onclick="Serv.Apps.open('magine','杂志','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_012.png"><br>杂志</a></li>
		 <li id="quick_special"><a href="javascript:void(0);" onclick="Serv.Apps.open('special','专题','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_015.png"><br>专题</a></li>
		 <li id="quick_pk"><a href="javascript:void(0);" onclick="Serv.Apps.open('pk','辩论','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_016.png"><br>辩论</a></li>
		 <li id="quick_adsview"><a href="javascript:void(0);" onclick="Serv.Apps.open('adsview','广告','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon.png"><br>广告</a></li>
		 <li id="quick_test"><a href="javascript:void(0);" onclick="Serv.Apps.open('test','试题','');return false;"><img src="VeryIDE%20Bee%20%201.2%20-%20%E4%BA%92%E5%8A%A8%E8%90%A5%E9%94%80%E5%B9%B3%E5%8F%B0%20-%20Powered%20By%20VeryIDE_files/icon_005.png"><br>试题</a></li>
		  -->
		 </ul>
	 </div>   
	<div id="container">
		<div id="photos" class="galleryview">
			<div id="couponShowArea"></div>
			  <ul class="filmstrip"></ul>
			</div>
	</div>
	<div id="footbg">
		<div id="footer">
			<div>Powered by <a href="http://www.veryide.com//search.php?q=Bee" target="_blank" title="Powered by VeryIDE">VeryIDE</a></div>
		</div>  
	</div>
</div> 
</body>
</html>